﻿
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace ContractManager.Common.Class
{
    /// <summary>
    /// MessageUtil µÄÕªÒªËµÃ÷¡£
    /// </summary>
    public static class MessageUtil
    {
        /// <summary>
        /// ÏÔÊ¾Ò»°ãµÄÌáÊ¾ÐÅÏ¢
        /// </summary>
        /// <param name="message">ÌáÊ¾ÐÅÏ¢</param>
        public static DialogResult ShowTips(string message)
        {
            return XtraMessageBox.Show(message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        /// <summary>
        /// ÏÔÊ¾¾¯¸æÐÅÏ¢
        /// </summary>
        /// <param name="message">¾¯¸æÐÅÏ¢</param>
        public static DialogResult ShowWarning(string message)
        {
            return XtraMessageBox.Show(message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        /// <summary>
        /// ÏÔÊ¾´íÎóÐÅÏ¢
        /// </summary>
        /// <param name="message">´íÎóÐÅÏ¢</param>
        public static DialogResult ShowError(string message)
        {
            return XtraMessageBox.Show(message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        /// <summary>
        /// ÏÔÊ¾Ñ¯ÎÊÓÃ»§ÐÅÏ¢£¬²¢ÏÔÊ¾´íÎó±êÖ¾
        /// </summary>
        /// <param name="message">´íÎóÐÅÏ¢</param>
        public static DialogResult ShowYesNoAndError(string message)
        {
            return XtraMessageBox.Show(message, "Lỗi", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
        }

        /// <summary>
        /// ÏÔÊ¾Ñ¯ÎÊÓÃ»§ÐÅÏ¢£¬²¢ÏÔÊ¾ÌáÊ¾±êÖ¾
        /// </summary>
        /// <param name="message">´íÎóÐÅÏ¢</param>
        public static DialogResult ShowYesNoAndTips(string message)
        {
            return XtraMessageBox.Show(message, "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
        }

        /// <summary>
        /// ÏÔÊ¾Ñ¯ÎÊÓÃ»§ÐÅÏ¢£¬²¢ÏÔÊ¾¾¯¸æ±êÖ¾
        /// </summary>
        /// <param name="message">¾¯¸æÐÅÏ¢</param>
        public static DialogResult ShowYesNoAndWarning(string message)
        {
            return XtraMessageBox.Show(message, "Cảnh báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
        }

        /// <summary>
        /// ÏÔÊ¾Ñ¯ÎÊÓÃ»§ÐÅÏ¢£¬²¢ÏÔÊ¾ÌáÊ¾±êÖ¾
        /// </summary>
        /// <param name="message">´íÎóÐÅÏ¢</param>
        public static DialogResult ShowYesNoCancelAndTips(string message)
        {
            return XtraMessageBox.Show(message, "Thông báo", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
        }
    }
}
